import argparse

from capcut_subtitile import expoet_srt
from subtitle_check import check_subtitles


def main():
    parser = argparse.ArgumentParser(description="剪映字幕文件转换工具")
    parser.add_argument("--output_dir", default="~/Downloads", help="输出目录")
    parser.add_argument("--ref", default=None, help="原始文本文件路径")
    args = parser.parse_args()
    ref_path = args.ref
    srts = expoet_srt(args.output_dir)
    if srts:
        srt = srts[0]
        output = srt.rsplit(".", 1)[0] + "_check.srt"
        check_subtitles(srt, output, ref_path)


if __name__ == "__main__":
    main()
